<?php
namespace app\admin\controller;
/**
 * 友情链接控制器
 */
class User extends AdminBase
{
    
    /**
     * 友情链接列表
     */
    public function userList()
    {
        
        $this->assign('list', $this->logicUser->getUserList());
        
        return $this->fetch('user_list');
    }
    
    /**
     * 友情链接添加
     */
    public function userAdd()
    {
        
        IS_POST && $this->jump($this->logicUser->userEdit($this->param));
        
        return $this->fetch('user_edit');
    }
    
    /**
     * 友情链接编辑
     */
    public function userEdit()
    {
        
        IS_POST && $this->jump($this->logicUser->userEdit($this->param));
        
        $info = $this->logicUser->getUserInfo(['id' => $this->param['id']]);
        
        $this->assign('info', $info);
        
        return $this->fetch('user_edit');
    }
    
    /**
     * 友情链接删除
     */
    public function userDel($id = 0)
    {
        
        $this->jump($this->logicUser->userDel(['id' => $id]));
    }
}
